var mysql = require('mysql');
var conn = mysql.createConnection({
	host: 'localhost',
	port: 3306,
	user: 'root',
	password: 'root',
	database: 'test',
	multipleStatements: true
});

conn.connect();

// conn.query('insert into user (name,age,intro) values("wang",2,"wangIntro")', function(err, rows, fields) {
// 	if (err) throw err;
// 	console.log(rows);
// })



// conn.query('insert into user (name,age,intro) values(?,?,?)' ,["wang", 2, "wangIntro"], function(err, rows, fields) {
// 	if (err) throw err;
// 	console.log(rows);
// })

conn.query('insert into user (name,age,intro) values(?,?,?)' ,["wang", 2, "wangIntro"], function(err, rows, fields) {
	if (err) throw err;
	console.log(rows);
})
// conn.query('insert into user set ?' ,[{name:'li',age:33,intro:"li_Intro"},{name:'li11',age:33,intro:"li_Intro"}], function(err, rows, fields) {
// 	if (err) throw err;
// 	console.log(rows);
// })

// conn.query('insert into user (name,age,intro) values("zzz",33,"zzzIntro");select * from user;', function(err, rows, fields) {
// 	if (err) throw err;
// 	console.log(rows);
// })

// conn.query('select 1;select 2', function(err, rows, fields) {
// 	if (err) throw err;
// 	console.log(rows);
// })


conn.query('select * from user where id < ?',[100], function(err, rows) {
	if (err) throw err;
	console.log(rows);
})

// conn.query('update user set age=age+10 ', function(err, rows) {
// 	if (err) throw err;
// 	console.log(rows);
// })


conn.end();